Assertion-based Loop Invariant Generation
نویسنده
چکیده
Many automated techniques for invariant generation are based on the idea that the invariant should show that something “bad” will not happen in the analyzed program. In this article we present an algorithm for loop invariant generation in programs with assertions using a weakest precondition calculus. We have realized the algorithm in the extended static checker ESC/Java2. Challenges stemming from our initial experience with the implementation are also discussed.
منابع مشابه
Synthesizing Invariants by Solving Solvable Loops
When proving invariance properties of a program, we face two problems. The first problem is related to the necessity of proving tautologies of considered assertion language, whereas the second manifests in the need of finding sufficiently strong invariants. This paper focuses on the second problem and describes a new method for the automatic generation of loop invariants that handles polynomial...
متن کاملInvariant functions and invariant relations: An alternative to invariant assertions
Whereas the analysis of loops in imperative programs is, justifiably, dominated by the concept of invariant assertion, we submit a related but different concept, of invariant relation, and show how it can be used to compute or approximate the function of a while loop. We also introduce the concept of invariant function, which is used to generate a broad class of invariant relations.
متن کاملPredicate Generation for Learning-Based Quantifier-Free Loop Invariant Inference
We address the predicate generation problem in the context of loop invariant inference. Motivated by the interpolation-based abstraction refinement technique, we apply the interpolation theorem to synthesize predicates implicitly implied by program texts. Our technique is able to improve the effectiveness and efficiency of the learning-based loop invariant inference algorithm in [14]. Experimen...
متن کاملLoop Invariant Symbolic Execution for Parallel Programs
Techniques for verifying program assertions using symbolic execution exhibit a significant limitation: they typically require that (small) bounds be imposed on the number of loop iterations. For sequential programs, there is a way to overcome this limitation using loop invariants. The basic idea is to assign new symbolic constants to the variables modified in the loop body, add the invariant to...
متن کاملTrace Generalization via Loop Compression
We present a new method to generalize execution traces by compressing loop iterations in them using loop invariants. The invariants discovered are “safe” such that the resulting compressed trace also satisfies certain target properties which the original trace satisfied (e.g., an assertion at the end). This results in a concise trace that captures the semantics of the original trace w.r.t. the ...
متن کامل